<template>
  <div class="canvas-view">
    <div class="card-view">
      <div class="card-label">基础用法</div>
      <div class="card-list">
        <div
          class="data-list"
          v-for="(item, idx) in dataList"
          :key="idx"
          @click="getMessage(item)"
        >
          <div class="label">
            <span>{{ item.label }}</span>
            <span class="msg"> {{ item.msg }}</span>
          </div>
          <van-icon class="arrow-icon" name="arrow" />
        </div>
      </div>
    </div>

    <div class="item-vew">
      <div class="title">学习文档：</div>
      <div class="info">
        <a href="https://www.w3school.com.cn/tags/html_ref_canvas.asp">
          w3school Canvas</a
        >
        <a href="https://www.runoob.com/html/html5-canvas.html">
          菜鸟驿站 Canvas</a
        >
      </div>
    </div>
    <p></p>
  </div>
</template>
<script>
export default {
  data() {
    return {
      dataList: [
        {
          label: "静态Canvas",
          value: "static",
        },
        {
          label: "动态Canvas",
          value: "canvasAnimat",
        },
      ],
    };
  },
  methods: {
    getMessage(item) {
      this.$router.push({
        name: item.value,
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.canvas-view {
  height: 100%;
  padding: 0 12px;
  box-sizing: border-box;
  .card-view {
    .card-label {
      margin: 0;
      padding: 16px;
      color: rgba(69, 90, 100, 0.6);
      font-weight: normal;
      font-size: 14px;
      line-height: 16px;
    }
    .card-list {
      overflow: hidden;
      border-radius: 8px;
      .data-list {
        position: relative;
        display: flex;
        justify-content: space-between;
        box-sizing: border-box;
        width: 100%;
        padding: 10px 16px;
        overflow: hidden;
        color: #323233;
        font-size: 15px;
        line-height: 24px;
        background-color: #fff;
        ::after {
          position: absolute;
          box-sizing: border-box;
          content: " ";
          pointer-events: none;
          right: 16px;
          bottom: 0;
          left: 16px;
          border-bottom: 1px solid #ebedf0;
          -webkit-transform: scaleY(0.5);
          transform: scaleY(0.5);
        }
        &:last-child {
          ::after {
            content: none;
          }
        }
        .arrow-icon {
          height: 24px;
          font-size: 16px;
          line-height: 24px;
          margin-left: 4px;
          color: #969799;
        }
        .msg {
          font-size: 12px;
          color: #666;
          margin-left: 5px;
        }
      }
    }
  }
  .item-vew {
    margin-top: 12px;
    .title {
      font-size: 15px;
    }
    .info {
      font-size: 14px;
      text-indent: 20px;
      color: #666;
      line-height: 20px;
    }
  }
}
</style>